package com.cloudkinto.service.stock;

import com.cloudkinto.entity.StockRecordDo;
import com.baomidou.mybatisplus.extension.service.IService;

import com.cloudkinto.common.web.PageResult;
import com.cloudkinto.common.web.SingleResult;
import com.cloudkinto.service.stock.vo.StockTurnoverRatePageRes;
import com.cloudkinto.service.stock.vo.record.StockRecordPageRes;
import com.cloudkinto.service.stock.vo.record.StockRecordSendReq;

import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
import java.util.List;
import java.util.Map;

/**
 * <p>
 *  service接口
 * </p>
 * @author 张永远
 * @since 2020-06-10
 */
public interface StockRecordService extends IService<StockRecordDo> {

    SingleResult updateInit(Long id);

    Object update(Object updateVo, Long userId);

    int delete(Long id, Long userId);

    Object detail(Long id, Long companyId);

    SingleResult pageInit (Long companyId,Long userId);

    List<StockRecordPageRes> getList(Map<String, String> map);

    void exportStockRecord(Map<String, String> map, HttpServletResponse response);

    PageResult getListPage(Map<String, String> map);

    SingleResult sendOut(StockRecordSendReq req,Long userId,Long companyId);

    public SingleResult openApiSendOut(StockRecordSendReq req, Long userId, Long companyId);

    PageResult getApiListPage(Map<String, String> map);

    SingleResult sendOutInit();

    PageResult<StockTurnoverRatePageRes> turnoverRateList(Map<String, String> map);

    SingleResult<StockTurnoverRatePageRes> turnoverRateTotal(Map<String, String> map);

    Map stockAge(Long id);

    /**********************库存快照模块**********************/

    PageResult getStockSnapshotPage(Map<String, String> map);

    List<StockSnapshotExportVo> getStockSnapExportList(Map<String, String> map);

    String exportExcel(Map<String, String> map, String fileName) throws IOException;

    void exportProductStockDetail(Map<String, String> map, HttpServletResponse response);

    void exportProductStockDetailFalse(Map<String, String> map, HttpServletResponse response);

    PageResult getStockListGroupCompany(Map<String, String> map);

    void freezeStock(Long productId, Long storageId, Long shopId, int type, int freezeCount, Long userId);

    void freezeStock(Long productId, Long userId);

    int getStockCount(Long companyId, Long shopId, Long id, Long productId, Integer integer);


}
